package com.xuecheng.ucenter.feginclient;

import feign.hystrix.FallbackFactory;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author: Hes
 * @description 验证码熔断服务
 * @date: 2023/6/26 16:23
 */
@Component
@Slf4j
public class CheckCodeClientFactory implements FallbackFactory<CheckCodeClient> {
    @Override
    public CheckCodeClient create(Throwable throwable) {
        return new CheckCodeClient() {
            @Override
            public Boolean verify(String key, String code) {
                log.debug("验证码远程服务熔断，错误信息:", throwable.getMessage());
                return null;
            }
        };
    }
}
